<?php
namespace Home\Controller;
use Think\Controller;
class AddressController extends Controller{
    public function address_add(){
//        新增收货地址
        $user_name=session('user_name');
        $home_user=D('Home/HomeUser');
        $user=$home_user->where('user_name='.$user_name)->select();
        $user_id=$user[0]['user_id']+0;
        $_POST['user_id']=$user_id+0;
        $address=D('Home/Address');
        $add=$address->add($_POST);
        if (!$add){
            $this->error('新增地址失败');
        }
        $this->redirect('Cart/cart_flowt');
    }
//    管理收货地址
    public function address_edit(){
       $this->display();
    }
}